import request from "@/api/index.js"

// login
export function login(data) {
  return request({
    url: `/account/auth`,
    method: "post",
    data: data
  })
}
// 注册
export function register(data) {
  return request({
    url: `/account/register`,
    method: "post",
    data: data
  })
}

// 注册
export function captcha(email) {
  return request({
    url: `/account/captcha`,
    method: "post",
    data: {
      email: email
    }
  })
}

// 校验验证码
export function validationCaptcha(type, email, captcha) {
  return request({
    url: `/account/validation-captcha/${type}`,
    method: "post",
    data: {
      "email": email, //邮箱地址
      "code": Number(captcha) //邮箱验证码
    }
  })
}

// 重置密码
export function resetPassword(data) {
  return request({
    url: `/account/reset-password`,
    method: "post",
    data:data
  })
}
